package com.xjy.headfirst.工厂模式;

/**
 * decription:
 *
 * @author 辛纪元
 * @since 2022-06-23
 */

public class HaPizza extends Pizza{

    PizzaIngredientFactory pizzaIngredientFactory;

    public HaPizza(PizzaIngredientFactory pizzaIngredientFactory){
        this.pizzaIngredientFactory = pizzaIngredientFactory;
    }

    @Override
    void prepare2() {
        this.dough = pizzaIngredientFactory.createDough();
        this.sauce = pizzaIngredientFactory.createSauce();
    }
}
